#ifndef COMMON_EXPORT_H
#define COMMON_EXPORT_H

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx MSVC 工具链
#ifdef _WIN32
#    ifdef COMMON_STATIC_DEFINE
#        define COMMON_EXPORT
#        define COMMON_NO_EXPORT
#    else
#        ifndef COMMON_EXPORT
#            ifdef common_EXPORTS
/* We are building this library */
#                define COMMON_EXPORT __declspec(dllexport)
#            else
/* We are using this library */
#                define COMMON_EXPORT __declspec(dllimport)
#            endif
#        endif

#        ifndef COMMON_NO_EXPORT
#            define COMMON_NO_EXPORT
#        endif
#    endif

#    ifndef COMMON_DEPRECATED
#        define COMMON_DEPRECATED __declspec(deprecated)
#    endif

#    ifndef COMMON_DEPRECATED_EXPORT
#        define COMMON_DEPRECATED_EXPORT COMMON_EXPORT COMMON_DEPRECATED
#    endif

#    ifndef COMMON_DEPRECATED_NO_EXPORT
#        define COMMON_DEPRECATED_NO_EXPORT COMMON_NO_EXPORT COMMON_DEPRECATED
#    endif

/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#    if 0 /* DEFINE_NO_DEPRECATED */
#        ifndef COMMON_NO_DEPRECATED
#            define COMMON_NO_DEPRECATED
#        endif
#    endif

//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx GCC 工具链
#elif defined(__GNUC__)
#    ifdef COMMON_STATIC_DEFINE
#        define COMMON_EXPORT
#        define COMMON_NO_EXPORT
#    else
#        ifndef COMMON_EXPORT
#            ifdef common_EXPORTS
/* We are building this library */
#                define COMMON_EXPORT __attribute__((visibility("default")))
#            else
/* We are using this library */
#                define COMMON_EXPORT __attribute__((visibility("default")))
#            endif
#        endif

#        ifndef COMMON_NO_EXPORT
#            define COMMON_NO_EXPORT __attribute__((visibility("hidden")))
#        endif
#    endif

#    ifndef COMMON_DEPRECATED
#        define COMMON_DEPRECATED __attribute__((__deprecated__))
#    endif

#    ifndef COMMON_DEPRECATED_EXPORT
#        define COMMON_DEPRECATED_EXPORT COMMON_EXPORT COMMON_DEPRECATED
#    endif

#    ifndef COMMON_DEPRECATED_NO_EXPORT
#        define COMMON_DEPRECATED_NO_EXPORT COMMON_NO_EXPORT COMMON_DEPRECATED
#    endif

/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#    if 0 /* DEFINE_NO_DEPRECATED */
#        ifndef COMMON_NO_DEPRECATED
#            define COMMON_NO_DEPRECATED
#        endif
#    endif
#endif  // defined(__GNUC__)

#endif /* COMMON_EXPORT_H */